<template>
  <el-descriptions title="患者信息" border="true" column="1" size="large">
    <el-descriptions-item label="姓名">{{ patientInfo.name }}</el-descriptions-item
    ><br />
    <el-descriptions-item label="性别">{{ patientInfo.sex }}</el-descriptions-item
    ><br />
    <el-descriptions-item label="出生日期">{{ patientInfo.birth }}</el-descriptions-item
    ><br />
    <el-descriptions-item label="住址">{{ patientInfo.address }}</el-descriptions-item
    ><br />
  </el-descriptions>
</template>
<script>
import request from "@/utils/forward/request";

export default {
  data() {
    return {
      patientHistoryId: "",
      patientInfo: {},
    };
  },
  mounted() {
    //4. 从store获取病历ID，向后端请求记录到data.record
    const patientHistoryId = this.$store.state.doctorOptions.patientHistoryId;
    request("get", "patient/getPatientInfo", {
      patientHistoryId: patientHistoryId,
    }).then((res) => {
      this.patientInfo = res.result;
    });
  },
};
</script>
